home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / pxfdirectory.z / pxfdirectory
Encoding:
Text File  |  2002-10-03  |  7.9 KB  |  170 lines

  1. PXFDIRECTORY(3F)                                      Last changed: 1-22-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFOOPPEENNDDIIRR, PPXXFFRREEAADDDDIIRR, PPXXFFRREEWWIINNDDDDIIRR, PPXXFFCCLLOOSSEEDDIIRR, - Performs
  6.      directory operations
  7.  
  8. SSYYNNOOPPSSIISS
  9.      SSUUBBRROOUUTTIINNEE PPXXFFOOPPEENNDDIIRR ((_d_i_r_n_a_m_e,, _l_e_n_d_i_r_n_a_m_e,, _i_o_p_e_n_d_i_r_i_d,, _i_e_r_r_o_r))
  10.      CCHHAARRAACCTTEERR*_n _d_i_r_n_a_m_e
  11.      IINNTTEEGGEERR _l_e_n_d_i_r_n_a_m_e,, _i_o_p_e_n_d_i_r,, _i_e_r_r_o_r
  12.  
  13.      SSUUBBRROOUUTTIINNEE PPXXFFRREEAADDDDIIRR ((_i_d_i_r_i_d,, _j_d_i_r_e_n_t,, _i_e_r_r_o_r))
  14.      IINNTTEEGGEERR _i_d_i_r_i_d,, _j_d_i_r_e_n_t,, _i_e_r_r_o_r
  15.  
  16.      SSUUBBRROOUUTTIINNEE PPXXFFRREEWWIINNDDDDIIRR ((_i_d_i_r_i_d,, _i_e_r_r_o_r))
  17.      IINNTTEEGGEERR _i_d_i_r_i_d,, _i_e_r_r_o_r
  18.  
  19.      SSUUBBRROOUUTTIINNEE PPXXFFCCLLOOSSEEDDIIRR ((_i_d_i_r_i_d,, _i_e_r_r_o_r))
  20.      IINNTTEEGGEERR _i_d_i_r_i_d,, _i_e_r_r_o_r
  21.  
  22. IIMMPPLLEEMMEENNTTAATTIIOONN
  23.      UNICOS, UNICOS/mk, and IRIX systems
  24.  
  25. SSTTAANNDDAARRDDSS
  26.      IEEE standard interface for FORTRAN 77
  27.  
  28. DDEESSCCRRIIPPTTIIOONN
  29.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  30.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  31.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  32.      F77 compiler.
  33.  
  34.      The PPXXFFOOPPEENNDDIIRR subroutine uses the ooppeennddiirr(3C) routine to open a
  35.      directory stream for the directory _d_i_r_n_a_m_e and positions the stream at
  36.      the first directory entry.
  37.  
  38.      The PPXXFFRREEAADDDDIIRR subroutine uses the rreeaaddddiirr(3C) function to read a
  39.      directory stream for the next entry in the directory stream.
  40.  
  41.      The PPXXFFRREEWWIINNDDDDIIRR subroutine uses the rreewwiinnddddiirr(3C) function to reset
  42.      the position in the directory stream to the first entry of a directory
  43.      stream while updating the directory stream to the current state of the
  44.      directory, as a call to PPXXFFOOPPEENNDDIIRR would do.
  45.  
  46.      The PPXXFFCCLLOOSSEEDDIIRR subroutine uses the cclloosseeddiirr(3C) function to close the
  47.      directory stream referenced by _i_d_i_r_i_d. Upon sucessful completion,
  48.      _i_d_i_r_i_d is undefined and the result of subsequent calls to PPXXFFCCLLOOSSEEDDIIRR
  49.      with _i_d_i_r_i_d is not well defined.
  50.  
  51.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  52.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  53.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  54.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  55.      IRIX, the default kind is KKIINNDD==44.
  56.  
  57.      The following is a list of valid arguments for these subroutines:
  58.  
  59.      _d_i_r_n_a_m_e   An input character array variable containing the path for
  60.                the directory to be opened.
  61.  
  62.      _l_e_n_d_i_r_n_a_m_e
  63.                An input integer variable containing the length of _d_i_r_n_a_m_e.
  64.  
  65.      _i_o_p_e_n_d_i_r_i_d
  66.                An output integer variable for the unique directory ID.
  67.  
  68.      _i_e_r_r_o_r    An output integer variable that contains zero if the
  69.                operation was successful or nonzero if the operation was not
  70.                successful.
  71.  
  72.      The _i_o_p_e_n_d_i_r_i_d argument becomes the unique directory ID (_i_d_i_r_i_d) that
  73.      is used by PPXXFFRREEAADDDDIIRR, PPXXFFRREEWWIINNDDDDIIRR, and PPXXFFCCLLOOSSEEDDIIRR.
  74.  
  75.      _i_d_i_r_i_d
  76.           An input integer variable for the unique directory ID generated
  77.           by PPXXFFOOPPEENNDDIIRR.
  78.  
  79.      _j_d_i_r_e_n_t
  80.           An output structure handle created by PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F) that
  81.           contains one directory entry.
  82.  
  83.      * The PPXXFFOOPPEENNDDIIRR subroutine may return any of the following error
  84.        values:
  85.  
  86.      EEAACCCCEESS    If a component of _d_i_r_n_a_m_e denies search permission.
  87.  
  88.      EENNAAMMEETTOOOOLLOONNGG
  89.                If the length of the _d_i_r_n_a_m_e argument exceeds PPAATTHH__MMAAXX found
  90.                in <<lliimmiittss..hh>> (IRIX systems only).
  91.  
  92.      EENNOOEENNTT    If the directory in the _d_i_r_n_a_m_e argument does not exist.
  93.  
  94.      EENNOOTTDDIIRR   If a component of _d_i_r_n_a_m_e is not a directory.
  95.  
  96.      EEIINNVVAALL    If _l_e_n_d_i_r_n_a_m_e < 0 or _l_e_n_d_i_r_n_a_m_e > LLEENN((_d_i_r_n_a_m_e)).
  97.  
  98.      EENNOOMMEEMM    If memory needed by PPXXFFOOPPEENNDDIIRR could not be allocated.
  99.  
  100.      EEMMFFIILLEE    If too many file descriptors are currently open for the
  101.                process.
  102.  
  103.      EENNFFIILLEE    If too many file descriptors are currently open for the
  104.                system (IRIX systems only).
  105.  
  106.      * The PPXXFFRREEAADDDDIIRR subroutine may return any of the following error
  107.        values:
  108.  
  109.      EEBBAADDFF     If, when detected, an invalid, unique directory stream ID
  110.                was used for _i_d_i_r_i_d.
  111.  
  112.      EEEENNDD      If the end of the directory stream has been reached.
  113.  
  114.      EENNOOMMEEMM    If data structures need for successful completion of
  115.                PPXXFFRREEAADDIIRR cannot be allocated.
  116.  
  117.      EENNOOEENNTT    If the current file pointer for the directory stream is not
  118.                located at a valid directory entry.
  119.  
  120.      EEDDIIRRCCOORRRRUUPPTTEEDD
  121.                If the directory on disk is corrupt (IRIX systems only).
  122.  
  123.      EEBBAADDIIDD    If _i_d_i_r_i_d is an invalid directory identifier (UNICOS and
  124.                UNICOS/mk systems only).
  125.  
  126.      EEBBAADDHHAANNDDLLEE
  127.                If _j_d_i_r_e_n_t is an invalid handle or has an incorrect handle
  128.                type (UNICOS and UNICOS/mk systems only).
  129.  
  130.      * The PPXXFFCCLLOOSSEEDDIIRR subroutine may return the following error value:
  131.  
  132.      EEBBAADDFF     If, when detected, an invalid, unique directory stream ID
  133.                was used for _i_d_i_r_i_d.
  134.  
  135. EEXXAAMMPPLLEESS
  136.      In this example, the //ddeevv//ddsskk directory is opened, the directory
  137.      entries are read and printed, the directory is rewound and the
  138.      contents are redisplayed, and then the directory is closed.
  139.  
  140.           program pxftest
  141.           integer ierror
  142.           integer (KIND=8) jdirent,idirid
  143.  
  144.           CALL PXFSTRUCTCREATE('dirent',jdirent,ierror)
  145.           CALL PXFOPENDIR('/dev/dsk',0,idirid,ierror)
  146.           call printdir(idirid,jdirent)
  147.           CALL PXFREWINDDIR(idirid,ierror)
  148.           call printdir(idirid,jdirent)
  149.           CALL PXFCLOSEDIR(idirid,ierror)
  150.           end
  151.  
  152.           subroutine printdir(idirid,jdirent)
  153.           integer ierror, ilen, EEND
  154.           integer (KIND=8) jdirent, idirid
  155.           character*30 name
  156.  
  157.           CALL PXFCONST('EEND',EEND,ierror)
  158.              do while ((ierror .ne. EEND) .and. (ierror .eq. 0))
  159.                 CALL PXFREADDIR(idirid,jdirent,ierror)
  160.                 CALL PXFSTRGET(jdirent,'d_name',name,ilen,ierror)
  161.                    if (ierror .eq. 0) print *,name
  162.              enddo
  163.           end
  164.  
  165. SSEEEE AALLSSOO
  166.      ddiirreeccttoorryy(3C)
  167.  
  168.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
  169.      version of this man page.
  170.